<div class="fly-tab">
    <span>
        <a href="{:U('/home/question/qlistall')}" <?php if(CONTROLLER_NAME=='Question' && ACTION_NAME=='qlistall'){ echo 'class="tab-this"'; }?>>
            全部
        </a>
        <a href="{:U('/home/question/qlistunsolved')}" <?php if(CONTROLLER_NAME=='Question' && ACTION_NAME=='qlistunsolved'){ echo 'class="tab-this"'; }?>>
            未结帖
        </a>
        <a href="{:U('/home/question/qlistsolved')}" <?php if(CONTROLLER_NAME=='Question' && ACTION_NAME=='qlistsolved'){ echo 'class="tab-this"'; }?>>
            已采纳
        </a>
        <a href="{:U('/home/question/qlistwonderful')}" <?php if(CONTROLLER_NAME=='Question' && ACTION_NAME=='qlistwonderful'){ echo 'class="tab-this"'; }?>>
            精帖
        </a>
        <?php if ($_SESSION['uid']) { ?>
            <a href="{:U('/home/question/qlistuser')}" <?php if(CONTROLLER_NAME=='Question' && ACTION_NAME=='qlistuser'){ echo 'class="tab-this"'; }?>>
                我的帖
            </a>
        <?php } ?>
    </span>
    <form action="https://www.baidu.com/s" class="fly-search">
        <i class="iconfont icon-sousuo">
        </i>
        <input class="layui-input" autocomplete="off" placeholder="搜索内容，回车跳转"
        type="text" name="wd">
    </form>
    <a href="{:U('/home/question/qsubmit')}" class="layui-btn jie-add">
        发布问题
    </a>
</div>
<script type="text/javascript">
    //搜索框
    $('.fly-search').submit(function() {
        var input = $(this).find('input'),
        val = input.val();
        if (val.replace(/\s/g, '') === '') {// 阻止空文本搜索
            return false;
        }
        input.val('site:layui.com ' + input.val());// 添加site标记，使搜索引擎指定网址的记录
    });
    $('.icon-sousuo').on('click',
    function() {
        $('.fly-search').submit();
    });
</script>